<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>登陆页面</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
	<script type="text/javascript" src="js/login.js"></script>
  </head>
  
  <body>
    	
		<h3>${mess }</h3>
	
	
	<%
		Cookie[] cookies = request.getCookies();
		String uname = "";
		String password = "";
		
		if(cookies != null){
			for(Cookie c : cookies){
				if(c.getName().equals("uname")){
					uname = c.getValue();
				}
				if(c.getName().equals("password")){
					password = c.getValue();
				}
			}
		}
	%>
	
	
	<form action="login.action" method="post">
		<table>
			<tr>
				<td></td>
				<td><h3>请登陆用户名</h3></td>
				<td></td>
			</tr>
			<tr>
				<td>用户名：</td>
				<td><input type="text" name="uname" value="<%=uname %>"/></td>
				<td></td>
			</tr>
			<tr>
				<td>密&nbsp;码：</td>
				<td><input type="password" name="pwd" value="<%=password %>"/></td>
				<td></td>
			</tr>
			
			<tr>
				<td>验证码：</td>
				<td><input type="text" name="verifyCode" value="<%=password %>"/></td>
				<td>
					<img id="code" src="verify/code.action">
					<a id="refresh">看不清，换一张</a>
				</td>
			</tr>
			
			<tr>
				<td></td>
				<td><input type="submit" name="login" value="登陆"/><input type="button" name="register" value="注册"/></td>
				<td></td>
			</tr>
			
		</table>
	</form>
  </body>
</html>
